import request from '@/utils/http'

const baseUrl = process.env.VUE_APP_JAVA_URL

const api = {
  selectSysDictList: baseUrl + '/sysparam/selectSysDictList',
  updateSysDict: baseUrl + '/sysparam/updateSysDict',
  getDictMaxCode: baseUrl + '/sysparam/getDictMaxCode',
  deleteSysDict: baseUrl + '/sysparam/deleteSysDict',
  saveDictInfo: baseUrl + '/sysparam/saveDictInfo',

  selectSysDictParamList: baseUrl + '/sysparam/selectSysDictParamList',
  updateSysDictParam: baseUrl + '/sysparam/updateSysDictParam',
  deleteSysDictParam: baseUrl + '/sysparam/deleteSysDictParam',
  saveDictParamInfo: baseUrl + '/sysparam/saveDictParamInfo'
}

export function selectSysDictList (params) {
  return request({
    url: api.selectSysDictList,
    method: 'post',
    data: params
  })
}

export function saveDictInfo (params) {
  return request({
    url: api.saveDictInfo,
    method: 'post',
    data: params
  })
}

export function updateSysDict (params) {
  return request({
    url: api.updateSysDict,
    method: 'post',
    data: params
  })
}

export function deleteSysDict (params) {
  return request({
    url: api.deleteSysDict,
    method: 'post',
    data: params
  })
}

export function getDictMaxCode (params) {
  return request({
    url: api.getDictMaxCode,
    method: 'get',
    data: params
  })
}

export function deleteSysDictParam (params) {
  return request({
    url: api.deleteSysDictParam,
    method: 'post',
    data: params
  })
}

export function selectSysDictParamList (params) {
  return request({
    url: api.selectSysDictParamList,
    method: 'post',
    data: params
  })
}

export function saveDictParamInfo (params) {
  return request({
    url: api.saveDictParamInfo,
    method: 'post',
    data: params
  })
}

export function updateSysDictParam (params) {
  return request({
    url: api.updateSysDictParam,
    method: 'post',
    data: params
  })
}
